/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-20 07:51:31
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-20 08:09:29
 */
import 'package:flutter/material.dart';
import 'package:flutter_data_center/components/loading.dart';
import 'package:flutter_data_center/controller/teacher_attendance_controller.dart';
import 'package:get/get.dart';

import 'teacher_item.dart';

class TeacherList extends StatelessWidget {
  const TeacherList({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) => GetBuilder<TeacherAttendanceController>(
        builder: (_controller) => _controller.list.length > 0
            ? ListView.builder(
                physics: BouncingScrollPhysics(),
                itemBuilder: (BuildContext context, int index) => TeacherItem(
                  teacher: _controller.list[index],
                  controller: _controller,
                ),
                itemCount: _controller.list.length,
              )
            : Loading(),
      );
}
